package cate.common.table.activity.diamondbowl.gift;

import cate.common.table.ESheet;
import cate.common.util.random.RWList;
import easy.java.dev.note.NoteClass;

import java.util.Optional;

@NoteClass("聚宝盆-钻石概率 Sheet")
public class DiamondBowlGiftSheet extends ESheet<DiamondBowlGiftRow> {
    @Override
    public String getSheetName() {
        return "钻石概率";
    }

    /**
     * 获取赠送的储存钻石随机数
     */
    public long getGiftNum() {
        return Optional.ofNullable(new RWList<>(getList()).setup().get())
                .map(row -> row.giftNum)
                .orElse(0L);
    }
}
